import { getCurrentInstance } from "vue";
/**
 @param target => string
*/
function useInstance(target) {
  const Instance = getCurrentInstance();
  const Properties = Instance.appContext.config.globalProperties;
  return target ? Properties[target] : Properties;
}

function loop(m, c) {
  return m.find((e) => (e.id === c ? e : loop(e.children, c)));
}

export { useInstance, loop };
